<button onclick="console.log('click')">btn</button>
<button onclick="fn()">btn2</button>
<script>
function fn() {
  for(let i=0; i<8*10**9; i++) {
  }
  console.log('循环结束')
}

</script>